﻿using System;
using System.Collections.Generic;
using System.Text;
using Kugar.UI.Web.AdminLTE.Helpers;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace Kugar.UI.Web.AdminLTE.PageControls.PageCommon
{
    public class PageCommon_Hidden : ControlBase
    {
        private string _name = "";
        private string _value = "";

        public PageCommon_Hidden(ViewContext viewContext) : base(viewContext)
        {
            this.Css("webui-ctrl-hidden");
        }

        public PageCommon_Hidden Name(string name)
        {
            _name = name;

            return this;
        }
        
        public PageCommon_Hidden Value(string value)
        {
            _value = value;

            return this;
        }

        public override HtmlString Render()
        {
            ViewContext.Writer.WriteLine($"<input type=\"hidden\" {Attributes} name=\"{_name}\" value=\"{_value}\"/>");

            return HtmlString.Empty;
        }
    }
}
